package com.nuoniu.sibanyun.mapper.erp;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.nuoniu.sibanyun.entity.erp.ErpPurchaseType;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/**
 * <p>
 * 采购类型管理表 Mapper 接口
 * </p>
 *
 * @author 小啊刚
 * @since 2020-12-08
 */
public interface ErpPurchaseTypeMapper extends BaseMapper<ErpPurchaseType> {

    @Update("update scb_purchase_type set is_default_value=0 where account_id=#{currentAccountId}")
    void updateDefaultValue(Integer currentAccountId);

    @Select("select count(1) from scb_purchase_type where account_id=#{accountId} and style_id=#{id}")
    Integer getByStyle(Long id, Integer accountId);
}
